Carbon


FSOpenFork

Header: Files.h Carbon status: Supported

Opens any fork of a file or directory for streaming access.

OSErr FSOpenFork (
    const FSRef *ref, 
    UniCharCount forkNameLength, 
    const UniChar *forkName, 
    SInt8 permissions, 
    SInt16 *forkRefNum
);
ref

A pointer to the file or directory containing the fork to open.

forkNameLength

The length of the fork name in Unicode characters.

forkName

A pointer to the name of the fork to open in Unicode. You can obtain the string constants for the data fork and resource fork using the FSGetDataForkName and FSGetResourceForkName calls.

permissions

Controls the way the file can be accessed via the returned fork reference (read-only or read/write). It is the same as the permission parameter passed to FSpOpenDF and FSpOpenRF.

forkRefNum

On return, a pointer to the reference number for accessing the open fork. The fork may be larger than 2GB, and is allowed to grow to 2GB or larger.

function result

A result code.

DISCUSSION

FSReadFork, FSWriteFork, FSCloseFork and related calls all require streaming access.

AVAILABILITY

Supported in Carbon. Available in Mac OS 9, and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)